package com.scienview.permission.user.model;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonValue;




@Entity
@Table(name="SV_USER")
//@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class User  implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 7811514729135993761L;
	private String userCode;
	private String userName;
	private String organId;
	private Integer age;
	private Sex  sex;
	private String password;
	
	public static enum Sex{
		MAN("男"),FEMAN("女");
		private String text;
		Sex(String text){
			this.text=text;
		}
		@JsonValue
		public String[] getText(){
			return new String[]{this.toString(),this.text};
		}
	}

	@Column(name="SEX_",length=10)
	@Enumerated(EnumType.STRING)
	public Sex getSex() {
		return sex;
	}
	public void setSex(Sex sex) {
		this.sex = sex;
	}
	
	
	@Column(name="USER_CODE",length=20)
	public String getUserCode() {
		return userCode;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	@Column(name="USER_NAME",length=100)
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	@Column(name="ORGAN_ID")
	public String getOrganId() {
		return organId;
	}
	public void setOrganId(String organId) {
		this.organId = organId;
	}
	@Column(name="AGE_",length=11)
	public Integer getAge() {
		return age;
	}
	public void setAge(Integer age) {
		this.age = age;
	}
	@Column(name="PASSWORD_",length=32)
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	
}
